ward off

verbs

prevent the occurrence of; prevent from happening
"Let's avoid a confrontation"; "head off a confrontation"; "avert a strike"
avert, turn away, or repel
"Ward off danger"
is a type of (narrower)
be on the defensive; act against an attack